package ahut2020.day06;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class P08FileCopy {
    public static void main(String[] args) {
        long start=System.currentTimeMillis();
        try {
            FileInputStream fis = new FileInputStream("A.txt");
            FileOutputStream fos = new FileOutputStream("B.txt");//覆盖模式
            //FileOutputStream fos = new FileOutputStream("B.txt",true);//追加模式

            int x;
            while((x=fis.read())!=-1){
                fos.write(x);
            }


            fis.close();
            fos.close();

        }catch(IOException e){

        }
        long end=System.currentTimeMillis();
        System.out.println(end-start);

    }
}
